import request from '@/utils/request'

// 获取分发列表
export function pagingShare(query) {
  return request({
    url: '/content/share/pagingShare',
    method: 'get',
    params: query
  })
}

// 校验是否有文章可分发
export function checkContentArticle(enterpriseId) {
  return request({
    url: '/content/distributeArticle/checkContentArticle',
    method: 'POST',
    params: { enterpriseId }
  })
}

// 分发保存
export function saveShare(share) {
  return request({
    url: '/content/share/saveShare',
    method: 'POST',
    data: share
  })
}

// 更改分发时间
export function updateShareDate(share) {
  return request({
    url: '/content/share/updateShareDate',
    method: 'POST',
    params: share
  })
}

// 结束任务
export function endShare(contentId) {
  return request({
    url: '/content/share/endShare',
    method: 'POST',
    params: { contentId }
  })
}

// 获取分发详情
export function getShare(contentId) {
  return request({
    url: '/content/share/getShare',
    method: 'get',
    params: { contentId }
  })
}

// 获取分发记录列表
export function pagingShareLog(query) {
  return request({
    url: '/content/shareLog/paging',
    method: 'get',
    params: query
  })
}
